﻿function pageLoad(sender, args)
{

    $addHandler($get("btnSave"),"click",SavePrivacy);

}
//保存我的隐私及偏好设置
function SavePrivacy()
{

    $get("btnSave").disabled = true;
    showProgressBar(true);
    var privacyDetailProfile= $get("Select1").selectedIndex;
        var privacyContactInfo= $get("Select2").selectedIndex;
        var privactLinkMan= $get("Select3").selectedIndex;
        var WhoViewComment= $get("Select4").selectedIndex;
        var WhoAddComment= $get("Select5").selectedIndex+1;
        var WhoChatMe= $get("Select6").selectedIndex+1;
        var WhoMsg= $get("Select7").selectedIndex+1;
        var AllowInvite;
        var privacyAgreeFriend;
        if($get("Radio1").checked==true)
        {
             AllowInvite="1";
        }
        if($get("Radio2").checked==true)
        {
             AllowInvite="0";
        }
        if($get("Radio3").checked==true)
        {
             privacyAgreeFriend="1";
        }
        if($get("Radio4").checked==true)
        {
             privacyAgreeFriend="0";
        }



 WebServices.My.UpdatePriacyLoved( MemberNo,  privacyAgreeFriend,  privacyDetailProfile,  privacyContactInfo,  privactLinkMan, WhoViewComment, WhoAddComment, WhoChatMe, WhoMsg,AllowInvite,onsucc);

  
}



function onsucc(result)
 {
   if(result)
   {
   $get("MessagesBox").style.display='';
      $get("MessageImg").src = MessageImageS;
        $get("MessageText").innerHTML = MessageTextS;
   }
   else
   {
   $get("MessagesBox").style.display='';
     $get("MessageImg").src = MessageImageF;
        $get("MessageText").innerHTML = MessageTextF;
    }
     scroller("MessagesBox",100);
    $get("btnSave").disabled = false;
    showProgressBar(false);
 }
 function Rend(divID)
{
    var domDiv1 = $get(divID);
   
   
    if(domDiv1!=null)
    {
        if($get("content")==null) return;
        var item= $get("content").innerHTML;
        var listBuilder = new Sys.StringBuilder();
       
     
            listBuilder.append(item);
        
        domDiv1.innerHTML = listBuilder.toString();
   }
}